package org.example.test.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import org.example.common.entity.AbstractEntity;

import javax.persistence.*;
import java.util.List;

/**
 * @author jzq
 * @date 2022/8/19 13:35
 */
@SuppressWarnings({"all"})
@Data
@Entity
@Table(name = "test_student")
public class Student extends AbstractEntity {

    private String studentName;

    @OneToOne(targetEntity = Card.class, cascade = CascadeType.ALL)
    @JoinColumn(name = "card_id",unique = true)
    private Card studentCard;

    @ManyToMany(mappedBy = "students",cascade = CascadeType.ALL)
    @JsonIgnore
    private List<Clazz> clazzes;

}
